package cn.edu.hit.kg.entity;

public enum RunningIssue{
    LEVEL_0("正常运行",0),
    LEVEL_1("监视运行",1),
    LEVEL_2("停机检修",2);
    RunningIssue(String name,int level){
        this.name = name;
        this.level = level;
    }
    private String name;
    private int level;

    public String getName() {
        return name;
    }

    public int getLevel() {
        return level;
    }

    public static RunningIssue asIssue(String name){
        switch (name){
            case "监视运行":
                return LEVEL_1;
            case "停机检修":
                return LEVEL_2;
                default:
                    return LEVEL_0;
        }
    }
}
